﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Fcdbas.WinUI.Common;
using Fcdbas.Biz;
namespace Fcdbas.WinUI.Forms
{
    public partial class dlgAddAppRoutingStep : BaseForm
    {
        private string key_name;
        private string key_ref;
        public dlgAddAppRoutingStep(string key_name_,string key_ref_)
        {
            InitializeComponent();
            key_name = key_name_;
            key_ref = key_ref_;
        }

        private void dlgAddAppRoutingStep_Load(object sender, EventArgs e)
        {
            this.MasterdataSourceBinding.AddNew();
            approval_routing en = this.MasterdataSourceBinding.Current as approval_routing;
            if (en != null)
                en.Status = Core.RecordStatus.New;
            en.key_name = key_name;
            en.key_ref = key_ref;
            cboPersonInfo.Properties.DataSource = ApprovalRouting.DisplayPersonInfo();
            cboPersonGroup.Properties.DataSource = ApprovalRouting.DisplayPersonGroup();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            cSessionManager.DbTransactionBegin();
            this.MasterdataSourceBinding.DataSourceSave(1);
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void cboPersonInfo_Popup(object sender, EventArgs e)
        {
            Console.Write("dd");
        }

        private void BtnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }
    }
}
